package cn.cxq.learning.e7;

import java.io.IOException;

public class Client {

    public static void main(String[] args) {

        int k;
        double OBJ;

        LeastSquare leastSquare = new LeastSquare();
        try {
            leastSquare.FormProblem();
        } catch (IOException e) {
            e.printStackTrace();
        }

        OBJ = leastSquare.SolutionCLEG();
        System.out.println(String.format("\n    OBJ = %13.5e", OBJ));
        for (k = 0; k < leastSquare.RM; k++) {
            System.out.println(String.format("\n    a%d = %13.5f", k, leastSquare.X[k]));
        }

    }
}
